import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';

//列表数据
export const columns: BasicColumn[] = [
   {
    title: '下单日期',
    align:"center",
    dataIndex: 'orderDate'
   },
  {
    title: '下料',
    align:"center",
    dataIndex: 'blanking'
  },
   {
    title: '型号',
    align:"center",
    dataIndex: 'machineModel_dictText'
   },
   {
    title: '框架',
    align:"center",
    dataIndex: 'assemble'
   },
   {
    title: '运动件',
    align:"center",
    dataIndex: 'assemble1'
   },
   {
    title: '内线',
    align:"center",
    dataIndex: 'assemble2'
   },
   {
    title: '外线',
    align:"center",
    dataIndex: 'assemble3'
   },
   {
    title: '斜撑平台',
    align:"center",
    dataIndex: 'assemble4'
   },
   {
    title: '外壳',
    align:"center",
    dataIndex: 'assemble5'
   },
   {
    title: '配货',
    align:"center",
    dataIndex: 'distribution'
   },
   {
    title: '检验',
    align:"center",
    dataIndex: 'checkout'
   },
   {
    title: '打包',
    align:"center",
    dataIndex: 'pack'
   },
   {
    title: '发货',
    align:"center",
    dataIndex: 'shipment'
   },
   {
    title: '是否启用   0 启用',
    align:"center",
    dataIndex: 'isEnable'
   },
   {
    title: '是否锁定 0 正常  -1 锁定',
    align:"center",
    dataIndex: 'isLock'
   },
   {
    title: '版本',
    align:"center",
    dataIndex: 'version'
   },

];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "型号",
      field: 'machineModel',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "是否启用   0 启用",
      field: 'isEnable',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "是否锁定 0 正常  -1 锁定",
      field: 'isLock',
      component: 'InputNumber',
      //colProps: {span: 6},
 	},
	{
      label: "版本",
      field: 'version',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '下单日期',
    field: 'orderDate',
    component: 'DatePicker',
    componentProps: {
       showTime: false,
     },
  },
  {
    label: '下料系数',
    field: 'blanking',
    component: 'Input',
  },

  {
    field: 'machineModel',
    component: 'JCategorySelect',
    label: '型号',
    componentProps: {
      pcode: 'A01',
      multiple: true
    }
  },
  {
    label: '框架系数',
    field: 'assemble',
    component: 'Input',
  },
  {
    label: '运动件系数',
    field: 'assemble1',
    component: 'Input',
  },
  {
    label: '内线系数',
    field: 'assemble2',
    component: 'Input',
  },
  {
    label: '外线系数',
    field: 'assemble3',
    component: 'Input',
  },
  {
    label: '斜撑平台系数',
    field: 'assemble4',
    component: 'Input',
  },
  {
    label: '外壳系数',
    field: 'assemble5',
    component: 'Input',
  },
  {
    label: '配货系数',
    field: 'distribution',
    component: 'Input',
  },
  {
    label: '检验系数',
    field: 'checkout',
    component: 'Input',
  },
  {
    label: '打包系数',
    field: 'pack',
    component: 'Input',
  },
  {
    label: '发货系数',
    field: 'shipment',
    component: 'Input',
  },
  {
    label: '是否启用   0 启用',
    field: 'isEnable',
    component: 'Input',
  },
  {
    label: '是否锁定 0 正常  -1 锁定',
    field: 'isLock',
    component: 'InputNumber',
  },
  {
    label: '版本',
    field: 'version',
    component: 'Input',
  },

	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  orderDate: {title: '下单日期',order: 0,view: 'datetime', type: 'string',},
  machineModel: {title: '型号',order: 1,view: 'text', type: 'string',},
  assemble: {title: '框架',order: 2,view: 'text', type: 'string',},
  assemble1: {title: '运动件',order: 3,view: 'text', type: 'string',},
  assemble2: {title: '内线',order: 4,view: 'text', type: 'string',},
  assemble3: {title: '外线',order: 5,view: 'text', type: 'string',},
  assemble4: {title: '斜撑平台',order: 6,view: 'text', type: 'string',},
  assemble5: {title: '外壳',order: 7,view: 'text', type: 'string',},
  distribution: {title: '配货',order: 8,view: 'text', type: 'string',},
  checkout: {title: '检验',order: 9,view: 'text', type: 'string',},
  pack: {title: '打包',order: 10,view: 'text', type: 'string',},
  shipment: {title: '发货',order: 11,view: 'text', type: 'string',},
  isEnable: {title: '是否启用   0 启用',order: 12,view: 'text', type: 'string',},
  isLock: {title: '是否锁定 0 正常  -1 锁定',order: 13,view: 'number', type: 'number',},
  version: {title: '版本',order: 14,view: 'text', type: 'string',},
  blanking: {title: '下料',order: 15,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
